<?php /* УТФ-8:fix */

class SPIcontroller__singlepage__front extends SPIcontroller__singlepage
{
	public function exec( & $content )
	{
		$content['topic_template_filename'] = 'singlepage/view.tpl';
		$content['active_topic'] = $content['env_topic'];

		if( false === ( $content['item_details'] = SPIm::I('singlepage')->front->get_by_tid( $content['env_topic'] ) ) )
		{
			return false;
		}

		$content['item_details']['title']    = SPI::I('lang')->consts->topic_name[$content['env_topic']];
		$content['item_details']['block_id'] = $content['env_topic'];

		$content['data']['right']    = SPIc::I('content')->front->get_last_content( 'news', 'random' );
		
		$content['data']['bottom']           = SPIc::I('content')->front->get_last_content( 'catalog', 'random' );
		$content['data']['bottom']['link']   = false;
		$content['data']['bottom']['title']  = SPI::I('lang')->content->see_too;
		
		$content['linkway'][] = array(
			'name'                => $content['item_details']['name'],
			'description'         => $content['item_details']['description'],

			'fixed_meta_title'    => $content['item_details']['meta_title'],
			'fixed_meta_descr'    => $content['item_details']['meta_description'],
			'fixed_meta_keywords' => $content['item_details']['meta_keywords'],

			'link'                => SPIc::I('front')->link->page( $content['env_topic'] ),
		);

		return true;
	}
}
